/*****************************************************************************/
/**
 *  @file   Parameter.h
 *  @author Naohisa Sakamoto
 */
/*----------------------------------------------------------------------------
 *
 *  Copyright (c) Visualization Laboratory, Kyoto University.
 *  All rights reserved.
 *  See http://www.viz.media.kyoto-u.ac.jp/kvs/copyright/ for details.
 *
 *  $Id$
 */
/*****************************************************************************/
#ifndef PARAMETER_H_INCLUDE
#define PARAMETER_H_INCLUDE

#include <kvs/TransferFunction>
#include <kvs/RGBColor>
#include <kvs/RGBFormulae>
#include <kvs/Type>
#include <kvs/LineObject>
#include <kvs/PolygonObject>
#include <kvs/UnstructuredVolumeObject>
#include <kvs/glut/Screen>
#include <kvs/glut/PushButton>
#include <kvs/glut/RadioButton>
#include <kvs/glut/RadioButtonGroup>
#include <kvs/glut/CheckBox>
#include <kvs/glut/Slider>
#include <kvs/glut/LegendBar>
#include <kvs/glut/OrientationAxis>
#include <kvs/glew/StochasticRenderingCompositor>
#include <cl/CellLocatorBIH.h>
#include <hsl/HyperStreamline.h>
#include <util/CubicPointObject.h>


struct Parameter
{
    kvstensorvis::util::CubicPointObject* point;
    kvstensorvis::hsl::HyperStreamline* line;
    kvs::PolygonObject* polygon;

    kvs::LineObject* bounds;
    kvs::UnstructuredVolumeObject* tensor;
    kvstensorvis::cl::CellLocatorBIH* locator;
    kvs::glew::StochasticRenderingCompositor* compositor;

    kvs::TransferFunction tfunc;
    kvs::UInt32 line_direction; // 0: major, 1: intermediate, 2: minor
    kvs::UInt32 line_opacity;
    kvs::UInt32 polygon_opacity;
    kvs::RGBColor polygon_color;
    kvs::Vector3f center;
    kvs::Real32 xmin, ymin, zmin;
    kvs::Real32 xmax, ymax, zmax;
    kvs::UInt32 resx, resy, resz;
    bool show_point;
    bool show_bounds;

    kvs::glut::Slider* polygon_opacity_slider;
    kvs::glut::CheckBox* point_check_box;
    kvs::glut::CheckBox* bounds_check_box;
    kvs::glut::Slider* xscale_slider;
    kvs::glut::Slider* yscale_slider;
    kvs::glut::Slider* zscale_slider;
    kvs::glut::Slider* xtranslate_slider;
    kvs::glut::Slider* ytranslate_slider;
    kvs::glut::Slider* ztranslate_slider;
    kvs::glut::Slider* xresolution_slider;
    kvs::glut::Slider* yresolution_slider;
    kvs::glut::Slider* zresolution_slider;
    kvs::glut::RadioButtonGroup* principal_button_group;
    kvs::glut::RadioButton* major_principal_button;
    kvs::glut::RadioButton* intermediate_principal_button;
    kvs::glut::RadioButton* minor_principal_button;
    kvs::glut::PushButton* extract_button;
    kvs::glut::PushButton* clear_button;
    kvs::glut::OrientationAxis* orientation_axis;
    kvs::glut::LegendBar* legend_bar;

    Parameter()
    {
        point = NULL;
        polygon = NULL;
        line = NULL;

        bounds = NULL;
        tensor = NULL;
        locator = NULL;
        compositor = NULL;

        tfunc.setColorMap( kvs::RGBFormulae::Rainbow( 256 ) );
        line_direction = 0;
        line_opacity = 128;
        polygon_opacity = 128;
        polygon_color = kvs::RGBColor( 255, 255, 255 );
        xmin = ymin = zmin = 0.0f;
        xmax = ymax = zmax = 0.0f;
        resx = resy = resz = 0;

        show_point = true;
        show_bounds = true;

        polygon_opacity_slider = NULL;
        point_check_box = NULL;
        bounds_check_box = NULL;
        xscale_slider = NULL;
        yscale_slider = NULL;
        zscale_slider = NULL;
        xtranslate_slider = NULL;
        ytranslate_slider = NULL;
        ztranslate_slider = NULL;
        xresolution_slider = NULL;
        yresolution_slider = NULL;
        zresolution_slider = NULL;
        principal_button_group = NULL;
        major_principal_button = NULL;
        intermediate_principal_button = NULL;
        minor_principal_button = NULL;
        extract_button = NULL;
        clear_button = NULL;
        orientation_axis = NULL;
        legend_bar = NULL;
    }

    ~Parameter()
    {
        delete tensor;
        delete locator;
        delete compositor;

        delete polygon_opacity_slider;
        delete point_check_box;
        delete bounds_check_box;
        delete xscale_slider;
        delete yscale_slider;
        delete zscale_slider;
        delete xtranslate_slider;
        delete ytranslate_slider;
        delete ztranslate_slider;
        delete xresolution_slider;
        delete yresolution_slider;
        delete zresolution_slider;
        delete principal_button_group;
        delete major_principal_button;
        delete intermediate_principal_button;
        delete minor_principal_button;
        delete extract_button;
        delete clear_button;
        delete orientation_axis;
        delete legend_bar;
    }
};

#endif // PARAMETER_H_INCLUDE
